<template>
    <view class="globe_back">
        <view class="box">
            <view class="cardBox">
                <view class="flex card">
                    <view class="title">手机号</view>
                    <view class="flex justify_content_between" style="width: 100%">
                        <view>159****8541</view>
                        <text class="f_28 cl_3377FF" v-if="time > 0">{{ time }}s</text>
                        <view class="cl_3377FF" v-else @click="setTime">获取验证码</view>
                    </view>
                </view>
                <view class="flex card">
                    <view class="title">验证码</view>
                    <view>
                        <input type="text" v-model="formData.yzm" placeholder="请填写验证码" />
                    </view>
                </view>
                <view class="flex card">
                    <view class="title">设置密码</view>
                    <view>
                        <input type="password" v-model="formData.newpassword" placeholder="请填写六位数支付密码" />
                    </view>
                </view>
                <view class="flex card">
                    <view class="title">确认密码</view>
                    <view>
                        <input type="password" v-model="formData.password" placeholder="请再次填写六位数支付密码确认" />
                    </view>
                </view>
            </view>

            <view class="addBtn back_3377FF br_24 cl_fff mt_24">确认</view>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            time: '',
            formData: {
                yzm: '',
                newpassword: '',
                password: ''
            }
        };
    },
    methods: {
        setTime() {
            let _this = this;
            _this.time = 90;
            let time = setInterval(() => {
                _this.time--;
                if (_this.time <= 0) {
                    clearInterval(time);
                }
            }, 1000);
        }
    }
};
</script>

<style scoped lang="scss">
.box {
    padding: 32rpx;
    .cardBox {
        border-radius: 24rpx;
    }
    .card {
        background: white;
        font-size: 28rpx;
        padding: 24rpx;
        .title {
            width: 148rpx;
            margin-right: 20rpx;
        }
    }
    .addBtn {
        width: 686rpx;
        height: 100rpx;
        line-height: 100rpx;
        text-align: center;
        margin: 24px auto;
        position: fixed;
        bottom: 80rpx;
    }
}
</style>
